package com.wangzeqi.changliaba.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.wangzeqi.changliaba.dao.User;
import com.wangzeqi.changliaba.dao.FragmentEntity;
import com.wangzeqi.changliaba.dao.ChatInformation;
import com.wangzeqi.changliaba.dao.AddPersonEntity;
import com.wangzeqi.changliaba.dao.ContactsEntity;
import com.wangzeqi.changliaba.dao.SingleData;
import com.wangzeqi.changliaba.dao.UserPage;
import com.wangzeqi.changliaba.dao.FriendCircle;

import com.wangzeqi.changliaba.dao.UserDao;
import com.wangzeqi.changliaba.dao.FragmentEntityDao;
import com.wangzeqi.changliaba.dao.ChatInformationDao;
import com.wangzeqi.changliaba.dao.AddPersonEntityDao;
import com.wangzeqi.changliaba.dao.ContactsEntityDao;
import com.wangzeqi.changliaba.dao.SingleDataDao;
import com.wangzeqi.changliaba.dao.UserPageDao;
import com.wangzeqi.changliaba.dao.FriendCircleDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig fragmentEntityDaoConfig;
    private final DaoConfig chatInformationDaoConfig;
    private final DaoConfig addPersonEntityDaoConfig;
    private final DaoConfig contactsEntityDaoConfig;
    private final DaoConfig singleDataDaoConfig;
    private final DaoConfig userPageDaoConfig;
    private final DaoConfig friendCircleDaoConfig;

    private final UserDao userDao;
    private final FragmentEntityDao fragmentEntityDao;
    private final ChatInformationDao chatInformationDao;
    private final AddPersonEntityDao addPersonEntityDao;
    private final ContactsEntityDao contactsEntityDao;
    private final SingleDataDao singleDataDao;
    private final UserPageDao userPageDao;
    private final FriendCircleDao friendCircleDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        fragmentEntityDaoConfig = daoConfigMap.get(FragmentEntityDao.class).clone();
        fragmentEntityDaoConfig.initIdentityScope(type);

        chatInformationDaoConfig = daoConfigMap.get(ChatInformationDao.class).clone();
        chatInformationDaoConfig.initIdentityScope(type);

        addPersonEntityDaoConfig = daoConfigMap.get(AddPersonEntityDao.class).clone();
        addPersonEntityDaoConfig.initIdentityScope(type);

        contactsEntityDaoConfig = daoConfigMap.get(ContactsEntityDao.class).clone();
        contactsEntityDaoConfig.initIdentityScope(type);

        singleDataDaoConfig = daoConfigMap.get(SingleDataDao.class).clone();
        singleDataDaoConfig.initIdentityScope(type);

        userPageDaoConfig = daoConfigMap.get(UserPageDao.class).clone();
        userPageDaoConfig.initIdentityScope(type);

        friendCircleDaoConfig = daoConfigMap.get(FriendCircleDao.class).clone();
        friendCircleDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        fragmentEntityDao = new FragmentEntityDao(fragmentEntityDaoConfig, this);
        chatInformationDao = new ChatInformationDao(chatInformationDaoConfig, this);
        addPersonEntityDao = new AddPersonEntityDao(addPersonEntityDaoConfig, this);
        contactsEntityDao = new ContactsEntityDao(contactsEntityDaoConfig, this);
        singleDataDao = new SingleDataDao(singleDataDaoConfig, this);
        userPageDao = new UserPageDao(userPageDaoConfig, this);
        friendCircleDao = new FriendCircleDao(friendCircleDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(FragmentEntity.class, fragmentEntityDao);
        registerDao(ChatInformation.class, chatInformationDao);
        registerDao(AddPersonEntity.class, addPersonEntityDao);
        registerDao(ContactsEntity.class, contactsEntityDao);
        registerDao(SingleData.class, singleDataDao);
        registerDao(UserPage.class, userPageDao);
        registerDao(FriendCircle.class, friendCircleDao);
    }
    
    public void clear() {
        userDaoConfig.getIdentityScope().clear();
        fragmentEntityDaoConfig.getIdentityScope().clear();
        chatInformationDaoConfig.getIdentityScope().clear();
        addPersonEntityDaoConfig.getIdentityScope().clear();
        contactsEntityDaoConfig.getIdentityScope().clear();
        singleDataDaoConfig.getIdentityScope().clear();
        userPageDaoConfig.getIdentityScope().clear();
        friendCircleDaoConfig.getIdentityScope().clear();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public FragmentEntityDao getFragmentEntityDao() {
        return fragmentEntityDao;
    }

    public ChatInformationDao getChatInformationDao() {
        return chatInformationDao;
    }

    public AddPersonEntityDao getAddPersonEntityDao() {
        return addPersonEntityDao;
    }

    public ContactsEntityDao getContactsEntityDao() {
        return contactsEntityDao;
    }

    public SingleDataDao getSingleDataDao() {
        return singleDataDao;
    }

    public UserPageDao getUserPageDao() {
        return userPageDao;
    }

    public FriendCircleDao getFriendCircleDao() {
        return friendCircleDao;
    }

}
